package com.example.lcpharmacy.controller;

import com.example.lcpharmacy.entity.ReceiverEntity;
import com.example.lcpharmacy.entity.reqBean.ReceiverBean;
import com.example.lcpharmacy.mapper.ReceiverDao;
import com.example.lcpharmacy.service.ReceiverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/receiver")
public class ReceiverImpl {

    @Autowired
    private ReceiverService receiverService;

    @Autowired
    private ReceiverDao receiverDao;

    /**
     * 保存收货人信息
     */
    @RequestMapping("saveRece")
    public String saveRece(@RequestBody ReceiverBean receiverBean){
        int result = receiverService.saveRece(receiverBean);
        if(result==1){
            return "收货地址保存成功！";
        }else{
            return "收货地址保存失败！";
        }
    }
}
